#pragma once
#ifndef TerrainEditPage_header_included
#define TerrainEditPage_header_included

#include "../GameLib/TERRAIN_BRUSH_MODE.h"
#include "../GameLib/TERRAIN_EDIT_MODE.h"
#include "../GameLib/TerrainLayerInfo.h"

class TerrainEditPage : public wxScrolledWindow
{
public:
	
	TerrainEditPage(wxWindow* parent);

	void OnCreateTerrain();
	void OnLoadTerrain();
	void OnSaveTerrain(wxCommandEvent& e);
	void OnTerrainHeightRadio(wxCommandEvent& e);
	void OnUseNormalMapCheckBox(wxCommandEvent& e);
	void OnTerrainBrushCombo(wxCommandEvent& e);
	void OnBrushSizeText(wxCommandEvent& e);
	void OnBrushWeightText(wxCommandEvent& e);
	void OnBrushConstantHeightText(wxCommandEvent& e);
	void OnAddLayer(wxCommandEvent& e);
	void OnSetFocusToTextureText(wxFocusEvent& e);
	void OnDeleteTextureButton(wxCommandEvent& e);
	void OnLayerWorldSizeText(wxCommandEvent& e);
	void OnLayerWorldSizeText_EnterPressed(wxCommandEvent& e);
	void OnEditBlend(wxCommandEvent& e);
	void OnDeleteLayerButton(wxCommandEvent& e);
	virtual bool Show(bool show = true);

	DECLARE_EVENT_TABLE()

private:
	void PopulateLayerWidgets();
	void AddLayerWidgets(unsigned index);

private:
	bool mTerrainCreated;
	TERRAIN_EDIT_MODE mEditingMode;
	unsigned mEditingBlendMapIndex;
	wxStaticBoxSizer* mLayerSizer;
	wxButton* mAddLayerButton;
	TerrainLayerInfo mTerrainLayerInfo;
	std::string mFilename;

};

#endif //TerrainEditPage_header_included